package com.wx.business.weixin.protocol;

import com.wx.business.weixin.common.Signature;

public class WxinSignatureDataH5 {

	private String noncestr;
	private String jsapi_ticket;
	private String timestamp;
	private String url;
	private String sign;

	public WxinSignatureDataH5(String ticket,String url,String noncestr,String timestamp) {
	
		// 随机字符串，不长于32 位
		setNoncestr(noncestr);
		setUrl(url);
		setJsapi_ticket(ticket);
		setTimestamp(timestamp);
		// 根据API给的签名规则进行签名
		String sign =Signature.getSha1(toString()) ;
		setSign(sign);
	}

	
	public String getNoncestr() {
		return noncestr;
	}


	public void setNoncestr(String noncestr) {
		this.noncestr = noncestr;
	}


	public String getJsapi_ticket() {
		return jsapi_ticket;
	}


	public void setJsapi_ticket(String jsapi_ticket) {
		this.jsapi_ticket = jsapi_ticket;
	}


	public String getTimestamp() {
		return timestamp;
	}


	public void setTimestamp(String timestamp) {
		this.timestamp = timestamp;
	}


	public String getUrl() {
		return url;
	}


	public void setUrl(String url) {
		this.url = url;
	}


	public String getSign() {
		return sign;
	}


	public void setSign(String sign) {
		this.sign = sign;
	}


	public String  toString() {
	
		return "jsapi_ticket="+getJsapi_ticket()+"&noncestr="+getNoncestr()+"&timestamp="+getTimestamp()+"&url="+getUrl();
		 
	}
}
